package top.wardyan.common.vo;

import com.alibaba.fastjson.JSONObject;

public class MQMsg{

	private static final cn.hutool.log.Log log = cn.hutool.log.Log.get();

	// code msg data
	Integer business;
	Object content;
	String datatype;
	String exchange;
	String from;
	String to;
	Integer custId;
	String routKey;
	Long sendTime;
	String type;
	String data;
	Long timestamp;
	
	Integer code;
	
	
	public static MQMsg parse(String mqstr) {
		MQMsg rs = new MQMsg();
		
		if(mqstr != null) {
			try {
				rs = JSONObject.parseObject(mqstr, MQMsg.class);
			}catch(Exception e) {
				log.error(e);
			}
		}else {
			log.error("尝试解析MQMsg对象时源字符串为空");
		}
		
		return rs;
	}
	
	
	public Integer getBusiness() {
		return business;
	}
	public MQMsg setBusiness(Integer business) {
		this.business = business;
		return this;
	}
	public Object getContent() {
		return content;
	}
	public MQMsg setContent(Object content) {
		this.content = content;
		return this;
	}
	public String getDatatype() {
		return datatype;
	}
	public MQMsg setDatatype(String datatype) {
		this.datatype = datatype;
		return this;
	}
	public String getExchange() {
		return exchange;
	}
	public MQMsg setExchange(String exchange) {
		this.exchange = exchange;
		return this;
	}
	public String getFrom() {
		return from;
	}
	public MQMsg setFrom(String from) {
		this.from = from;
		return this;
	}
	public String getTo() {
		return to;
	}
	public MQMsg setTo(String to) {
		this.to = to;
		return this;
	}
	public Integer getCustId() {
		return custId;
	}
	public MQMsg setCustId(Integer custId) {
		this.custId = custId;
		return this;
	}
	public String getRoutKey() {
		return routKey;
	}
	public MQMsg setRoutKey(String routKey) {
		this.routKey = routKey;
		return this;
	}
	public Long getSendTime() {
		return sendTime;
	}
	public MQMsg setSendTime(Long sendTime) {
		this.sendTime = sendTime;
		return this;
	}
	public String getType() {
		return type;
	}
	public MQMsg setType(String type) {
		this.type = type;
		return this;
	}
	public String getData() {
		return data;
	}
	public MQMsg setData(String data) {
		this.data = data;
		return this;
	}
	public Long getTimestamp() {
		return timestamp;
	}
	public MQMsg setTimestamp(Long timestamp) {
		this.timestamp = timestamp;
		return this;
	}
	
	
	
}
